#include <hiredis/hiredis.h>
#include <iostream>
using std::cout;
using std::endl;

void test0(){
    redisContext* rc = redisConnect("127.0.0.1",6379);
    
    if(!rc || rc->err)
    {
        cout << "连接失败" << endl;
        return;
    }
    cout << "连接成功" << endl;

    redisReply * rr = (redisReply*)redisCommand(rc,"incr k5");
    
    if(rr->type == 6)
    {
        cout << "执行失败" << endl;
        cout << rr->str << endl;
        return;
    }

    cout << rr->type << endl;

}

int main(){
    test0();
    return 0;
}